import request from '@/router/axios';

/**
 *
 * 检验单管理接口大全
 */
export const getPage = (current, size, params) => {
  return request({
    url: '/api/mes-product/inspection-document/documentPage',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getList = (params) => {
  return request({
    url: '/api/mes-product/inspection-document/list',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};
export const getDetail = (id) => {
  return request({
    url: '/api/mes-product/inspection-document/detail',
    method: 'get',
    params: {
      id
    }
  });
};

// 检验模板分页列表
export const getTemplatePage = (current, size, params) => {
  return request({
    url: '/api/mes-product/qms-inspection-template/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

// 发起重检,FQC-OQC
export const repeatExam = (row) => {
  return request({
    url: '/api/mes-product/inspection-document/repeatExam',
    method: 'post',

    data: row
    // data: qs.stringify({ documentIdList }, { arrayFormat: 'repeat' }, { charset: 'utf-8' })
    // params: { documentIdList },
    // paramsSerializer: function (params) {
    //   return qs.stringify(params, { arrayFormat: 'repeat' });
    // }
  });
};


/**
 *  查询MA MI CRI 数量
 */

export const getQcCalculateAqlInfo = (data) => {
  return request({
    url: '/api/mes-admin/aql/calculate-qc-info-by-aql',
    method: 'post',
    data
  });
}

/**
* 获取物料配置AQL信息
*/

export const getAqlInfo = (params) => {
  return request({
    url: 'api/mes-admin/partmaster/get-aql-info-by-part-id',
    method: 'get',
    params
  });
}

//撤销检验单
export const cancel = (params) => {
  return request({
    url: '/api/mes-product/inspection-document/cancel',
    method: 'get',
    params
  })
}

